package lib::Input::Html;

# This file is part of noplagia.
#
# noplagia is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# noplagia is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# noplagia; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA  02111-1307 USA

use strict;
use WWW::Mechanize;
use Data::Dumper;
use lib::TextTreatment;


require Exporter;
our ($VERSION,@ISA,@EXPORT,$context);

$VERSION = 0.01;

=head1 NAME

lib::Input::Html - opertation sur le texte d'entree

=head1 SYNOPSIS

    use lib::Input::Html;
    my $text = get_text($text);

=head1 DESCRIPTION

    Ce module permet de faire des operations sur le texte en entree

=head1 FUNCTIONS

=over 2

=cut

@ISA    = qw(Exporter);
@EXPORT = qw(
    &get_text
);

=item get_text

    my $text1 = get_text($html);

=cut

sub get_text {
    my $html = shift;
    my $mech = WWW::Mechanize->new();
    $mech->agent_alias('Linux Mozilla');
    $mech->get( $html );
    my $text = $mech->content( format => 'text' );
#     $text =~ s/</&lt;/gm;
    return set_noPunctuation($text);
}

END { }
1;
__END__

=back

=head1 AUTEUR

    noplagia dev team

    http://noplagia.org

=cut
